package com.example.stream;

import java.io.*;

/**
 * @author shanchong
 * @date 2019-07-05
 **/
public class Demo {


    public static void main(String[] args) {
        String s = "0003330F2616225||01|060994038980|TX09||1362T190627735840210200023651|4200000326201906278479319678|5.50|1|SUCCESS|2019-06-27 18:58:04|20190627||0.02|v9KS_84kvOcsKAikvo|M0325\n" +
                "0005150F2613830||01|060994139220|TX09||1362T190627401732771400012989|4200000334201906270893186192|6.00|1|SUCCESS|2019-06-27 19:02:25|20190627||0.02|ChrwKnDfINAWC7zbtg|M0325\n" +
                "0001000F2623447||01|060994167758|TX09||1362T190627361949833800014602|4200000331201906277132479007|11.80|1|SUCCESS|2019-06-27 18:58:05|20190627||0.03|1DyAQAVdOO9tuTEzyc|M0196\n" +
                "0001000F2623447||01|060994099153|TX09||1362T190627361949635400014602|4200000318201906271773239546|15.30|1|SUCCESS|2019-06-27 18:59:54|20190627||0.04|nNnDi1r9Su3e2C6pm4|M0196\n" +
                "0003330F2616225||01|060994651065|TX09||1362T190627735840088300023651|4200000336201906274092974556|122.30|1|SUCCESS|2019-06-27 19:04:10|20190627||0.46|3Y3J9wql0_lYG6YVn8|M0325\n" +
                "0001340F2615312||01|060994641469|TX09||1362T190627412916897900013494|4200000318201906271032291177|6.00|1|SUCCESS|2019-06-27 19:04:10|20190627||0.02|opQd-Re5pMCzdwVIyM|M0325\n" +
                "0001340F2614694||02|060994670932|TX15||1362T190627322940509000019497|2019062722001419120576910342|6.20|1|SUCCESS|2019-06-27 19:04:12|20190627||0.02|919126|M0325";
        BufferedReader bufferedReader = new BufferedReader(new StringReader(s));
        String data="";
        System.out.println(s.getBytes().length);
        int n = 0;
        while (true){
            try {
                if (!((data = bufferedReader.readLine())!=null)) break;
            } catch (IOException e) {
                e.printStackTrace();
            }
            int length = data.getBytes().length
                    +"\n".getBytes().length
                    ;
            n = n+length;

            System.out.println(data);
        }

        System.out.println(n-1);


    }
}
